Add regression coverage for overloaded initializer Java names#781
Merged
Conversation
ktoso
approved these changes
Jun 9, 2026
| public init(throwing: Swift.Bool) throws | ||
| public init(doInit: Swift.Bool) | ||
| } | ||
| """ |
Collaborator
There was a problem hiding this comment.
No real reason for two separate input strings
Contributor
Author
There was a problem hiding this comment.
Yub, I have consolidated into 1 shared input.
| "public static OverloadedInitializerClass init(boolean throwing, SwiftArena swiftArena)", | ||
| "public static java.util.Optional<OverloadedInitializerClass> init(boolean doInit, SwiftArena swiftArena)", | ||
| ] | ||
| ) |
Collaborator
There was a problem hiding this comment.
Make it one test that is parameterized over the two modes please
Contributor
Author
There was a problem hiding this comment.
Updated, thanks! I merged into 1 parameterized test over JNI/FFM.
Collaborator
|
Thanks :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds regression coverage for #425.
This covers the reported initializer-collision where distinct Swift initializers could otherwise produce duplicate Java
init(...)signatures. The added tests assert that the generated FFM/JNI Java names are disambiguated, e.g.initThrowingandinitDoInit, and that the raw duplicateinit(...)signatures are absent.Closes #425.
Test:
swift test --filter MethodImportTests